<template>
<view>
<!--<import src="../../../utils/wxParse/wxParse.wxml"></import>-->
<view class="container">
  <view class="type-navbar">
    <view v-for="(item, index) in categories" :key="index" class="type-box">
      <view :id="item.id" :class="'type-navbar-item ' + (activeCategoryId == item.id ? 'type-item-on' : '')" @tap="tabClick">
        {{item.name}}
      </view>
    </view>
    <view class="share-btn" @tap.stop="catchShare">
      <image src="/static/images/icon-share.png"></image>
    </view>
  </view>
  <view class="goods-detail">
    <!-- 商品首页 -->
    <view class="goods-info" :hidden="activeCategoryId==0?false:true">
      <swiper class="swiper_box" indicator-dots="true" vertical="false" autoplay="true" :interval="3000" :duration="1000">
        <block v-for="(item, index) in result.team_activity.goods.goods_images" :key="index">
          <swiper-item>
            <image class="wh100" :src="url + item.image_url" :data-src="url + item.image_url" @tap.stop="look"></image>
          </swiper-item>
        </block>
      </swiper>
      <view class="pt-goods">
        <view class="pt-goods-name ellipsis-2">{{result.team_activity.goods.goods_name}}</view>
        <view class="pt-tips">
          <view class="co-red">￥{{select.teamPrice ? select.teamPrice : select.price}}</view>
          <view v-if="select.prom_id > 0" class="pt-btn">{{select.statusDesc}}</view>
        </view>
        <view class="pt-price">市场价格 :
          <text>￥{{result.team_activity.goods.market_price}}</text>
        </view>
        <view class="pt-des">{{select.shareDesc}}</view>
        <view class="pt-icos">
          <view>
            <image src="/static/images/ico-pt1.png"></image>
            品质保障
          </view>
          <view>
            <image src="/static/images/ico-pt2.png"></image>
            放心物流
          </view>
          <view>
            <image src="/static/images/ico-pt3.png"></image>
            贴心服务
          </view>
        </view>
      </view>

      <block v-if="teamResult.teamFounds.length > 0">
        <view class="pt-order-tips">以下小伙伴正在发起团购，您可以直接参与</view>
        <view v-for="(item, index) in teamResult.teamFounds" :key="index" v-if="index <2" class="pt-order-list">
          <view class="just flex" v-if="index == 0">
            <view class="pt-order-tips">{{teamResult.teamFounds.length}}人正在开团，可直接参与</view>
            <view class="pt-order-tips" @tap.stop="catmore">查看更多</view>
          </view>
          <view class="pt-order-item">
            <view class="pt-order-cont">
              <view class="pt-user">
                <view class="ellipsis-1 co-333">{{item.nickname}}</view>
                <view class="ellipsis-1">{{item.address_region}}</view>
              </view>
              <view class="pt-time">
                <view class="ellipsis-1 co-red">还差{{item.surplus}}人成团</view>
                <view class="ellipsis-1">{{item.remainTime.hour}}:{{item.remainTime.minute}}:{{item.remainTime.second}}后结束</view>
              </view>
              <view class="pt-avtar">
                <image class="wh100" :src="item.head_pic ? item.head_pic : defaultAvatar"></image>
              </view>
            </view>
            <navigator class="pt-order-btn" :url="'/pages/team/team_detail/team_detail?foundId=' + item.found_id + '&goods_id=' + result.team_activity.goods.goods_id">去参与</navigator>
          </view>
        </view>
      </block>

      <view class="pt-rule">
        <view class="pt-rule-name">拼团规则</view>
        <view class="pt-rule-list">
          <view>
            <view class="pt-rule-num">1</view>
            <view>选择商品</view>
          </view>
          <view>
            <view class="pt-rule-num">2</view>
            <view>开团/参团</view>
          </view>
          <view>
            <view class="pt-rule-num">3</view>
            <view>邀请好友</view>
          </view>
          <view>
            <view class="pt-rule-num">4</view>
            <view>人满成团</view>
          </view>
        </view>
        <view :class="'pt-ico5 ' + (rule?'':'transform')" @tap="showRule">
          <image src="/static/images/ico-pt4.png"></image>
        </view>
        <view class="pt-rule-cont" :hidden="rule">
          <view>1.开团：在商城内选择喜欢的商品，点击“去开团”，付款成功后即为开团成功；</view>
          <view>2.参团：进入朋友分享的页面，点击“立即参团”，付款后即为参团成功，若多人同时支付，按先支付成功的用户获得参团资格；</view>
          <view>3.成团：在开团或参团之后,可以点击“分享出去”，在有效时间凑齐成团人数即拼团成功；</view>
          <view>4.组团失败：在有效时间内未凑齐人数，即为组团失败，此时商城会将原款分别退回；</view>
        </view>
      </view>
      <view class="user-comment logistics-item pd-bg-fff" @tap="tabComment">
        <view>用户评论</view>
        <view class="good-comment">好评率
          <view class="co-red"> {{result.team_activity.goods.comment_statistics.high_rate}}%</view>
        </view>
        <view class="comment-num">
          <view class="co-red">{{result.team_activity.goods.comment_statistics.total_sum}}</view>人评价
          <view class="item-img">
            <image class="wh100" src="/static/images/icon-arrowdown.png"></image>
          </view>
        </view>
      </view>
    </view>
    <!-- 商品详情 -->
    <view class="goods-norms" :hidden="activeCategoryId==1?false:true">
      <view class="type-navbar2">
        <view v-for="(item, index) in categories2" :key="index" class="type-box2">
          <view :id="item.id" :class="activeCategoryId2 == item.id ? 'type-item2-on' : ''" @tap="tabClick2">
            {{item.name}}
          </view>
        </view>
      </view>
      <view :hidden="activeCategoryId2==0?false:true" class="wxParse">
        <jyf-parser :html="article_content"></jyf-parser>
      </view>
      <view class="parameter" :hidden="activeCategoryId2==1?false:true">
        <view class="table">
          <view class="th-thitle tb">主体</view>
          <view v-for="(item, index) in goodsAttrs" :key="index" class="td-cont tb">
            <view class="td-title">{{item.attr_name}}</view>
            <view class="td-text">{{item.attr_value}}</view>
          </view>
        </view>
      </view>
    </view>
    <!-- 商品评论 -->
    <view class="goods-comment" :hidden="activeCategoryId==2?false:true">
      <view class="type-navbar3">
        <view v-for="(item, index) in categories3" :key="index" class="type-box3">
          <view :id="item.id" :class="activeCategoryId3 == item.id ? 'type-item3-on' : ''" @tap="tabClick3">
            <view>{{item.name}}</view>
            <view>{{item.num}}</view>
          </view>
        </view>
      </view>
      <view class="comment-list">
        <view v-for="(item, cIdx) in comments" :key="cIdx" class="comment-item">
          <view class="comment-title">
            <view class="user-name">
              <view class="user-pic">
                <image class="wh100" :src="item.is_anonymous ? defaultAvatar : item.head_pic ? url + item.head_pic : defaultAvatar"></image>
              </view>
              {{item.is_anonymous ? '匿名用户' : item.nickname}}
            </view>
            <view>{{item.addTimeFormat}}</view>
          </view>
          <view class="comment-cont">
            <view>
              <view class="stars">
                <view class="stars-checked">
                  <image v-for="(item, index) in item.goods_rank" :key="index" class="star" src="/static/images/star-red.png"></image>
                </view>
                <view class="stars-unchecked">
                  <image v-for="(item, index) in 5-item.goods_rank" :key="index" class="star" src="/static/images/star-gray.png"></image>
                </view>
              </view>
              <view class="state-spec ellipsis-1">{{item.spec_key_name?item.spec_key_name:''}}</view>
            </view>
            <view class="comment-mes">{{item.content}}</view>
            <view class="img-ul">
              <view v-for="(item, index) in item.img" :key="index" class="img-li">
                <image class="wh100" :src="item" @tap="previewCommentImgs" :data-cidx="cIdx" :data-id="index"></image>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
<!-- 返回顶部按钮  -->
<view class="toTop" @tap="doScrollTop" v-if="supportPageScroll">
  <image class="wh100" src="/static/images/topup.png"></image>
</view>
<!-- 购买栏  -->
<view class="join-cart">
  <view class="custom-service cart-ico" @tap="contactService">
    <image class="cs-img" src="/static/images/custom-service.png"></image>
    <view>客服</view>
  </view>
  <view class="custom-service cart-ico" @tap="collectGoods">
    <image :hidden="result.collect" class="cs-img" src="/static/images/heart.png"></image>
    <image :hidden="!result.collect" class="cs-img" src="/static/images/heart-h.png"></image>
    <view>收藏</view>
  </view>
  <view class="join-btn cart-btn" @tap="buyNormal">
    <view class="classname">单独购买</view>
    <view class="classname">￥{{select.price}}</view>
  </view>
  <view class="buy-btn cart-btn" @tap="openSpecModel">
    <view class="classname">{{select.needer ? select.needer : team.needer}}人团</view>
    <view class="classname">￥{{select.teamPrice ? select.teamPrice : team[0].team_price}}</view>
  </view>
</view>
<!-- 规格弹框  -->
<view :hidden="!openSpecModal">
  <view class="cover-layer" @tap="closeSpecModal"></view>
  <view class="spec-model">
    <icon type="cancel" color="gray" size="22" class="modal-close" @tap="closeSpecModal"></icon>
    <view class="spec-goods">
      <image class="wh100 spec-img" :src="spec_img"></image>
      <view class="spec-goods-info">
        <view class="spec-goods-name">{{result.team_activity.goods.goods_name}}</view>
        <view v-if="select.prom_id > 0" class="spec-goods-price">￥ {{select.teamPrice}}({{select.needer}}人团){{select.statusDesc}}</view>
        <view v-else class="spec-goods-price">￥ {{select.price}}</view>
        <view class="spec-goods-stock">剩余库存：{{select.stock}}</view>
      </view>
    </view>
    <block v-for="(item, listIdx) in result.team_activity.goods.spec" :key="listIdx">
      <view class="spec-name">{{item.spec_name}}</view>
      <view class="spec-wrap">
        <view v-for="(spec, index) in item.spec_item" :key="index" :class="'spec-btn ' + (item.selectItemId==spec.id?'spec-btn-click':'')" @tap="selectSpec" :data-listidx="listIdx" :data-itemid="spec.id">{{spec.item}}</view>
      </view>
    </block>
    <view class="muber_all">
      <view class="spec-name">数量</view>
      <view class="count">
        <view class="sub" @tap="subCartNum">-</view>
        <input type="number" :value="goodsInputNum" @blur="inputCartNum"></input>
        <view class="add" @tap="addCartNum">+</view>
      </view>
    </view>
    <view :class="'spec-cart-btn ' + (select.prom_id<=0||select.stock<=0 ? 'spec-cart-disable':'')" @tap="buyNow">立即购买</view>
  </view>
</view>


<view class="modal-mask" v-if="show" @tap="clickMask">
  <view class="modal-content">
    <view class="modal-title">正在拼单</view>
    <view class="modal-close"></view>
    <view class="modal-list">
      <block v-if="teamResult.teamFounds.length > 0">
        <view v-for="(item, index) in teamResult.teamFounds" :key="index" class="modal-list-content">
          <view class="modal-image">
            <image :src="item.head_pic?item.head_pic:defaultAvatar"></image>
          </view>
          <view class="modal-info">
          <view class="view">
            <view class="modal-person">{{item.nickname ? item.nickname:'用户' + item.user_id}}             
            </view>
            <view class="modal-person-info">还差{{item.surplus}}人</view>
          </view>
            <view class="modal-time">剩余{{item.remainTime.hour}}:{{item.remainTime.minute}}:{{item.remainTime.second}}</view>
          </view>
          <navigator class="modal-btn" :url="'/pages/team/team_detail/team_detail?foundId=' + item.found_id">去拼单</navigator>
        </view>
      </block>
    </view>
  </view>
</view>

<!-- 分享海报生成 -->

<view v-if="share_btn">
  <view class="cover-layer" @tap="closePromModal"></view>
  <view class="prom-model">
    <icon type="cancel" color="gray" size="22" class="modal-close" @tap="closeShareModal"></icon>
    <view class="prom-title">分享到朋友圈</view>
    <view class="share-pic">
      <image @tap.stop="previewSharePic" style="width:100%;height:100%" :src="share_pic"></image>
    </view>
    <view class="share-save-btns">
      <view class="share-save-btn" @tap.stop="saveSharePic">保存海报</view>
      <view class="share-tips">保存海报至相册，可在朋友圈分享海报</view>
    </view>

  </view>
</view>

<action-sheet :hidden="actionSheetHidden" @change="listenerActionSheet">
  <action-sheet-item>
    <button class="action-sheet-btn" open-type="share">发送给好友</button>
  </action-sheet-item>
  <action-sheet-item @tap.stop="getSharePic">分享到朋友圈</action-sheet-item>
  <action-sheet-cancel>取消</action-sheet-cancel>
</action-sheet>
</view>
</template>

<script>
var util = require("../../../utils/util.js");
var common = require("../../../utils/common.js");

var app = getApp();
var request = app.globalData.request;
var setting = app.globalData.setting;

export default {
  data() {
    return {
      url: setting.url,
      resourceUrl: setting.resourceUrl,
      defaultAvatar: setting.resourceUrl + "/static/static/images/user68.jpg",
      result: null,
      content: '',
      //商品详情页html
      goodsAttrs: null,
      //商品属性列表
      specSelect: 0,
      //选中的组合规格数组spec_goods_price下标
      optiongoodId: 0,
      optionItemId: 0,
      //页面参数，页面初始化指定显示的itemid，用于活动
      goodsInputNum: 1,
      //选中的商品件数
      openSpecModal: false,
      //是否打开规格弹窗
      activeCategoryId: 0,
      //商品主页tab
      supportPageScroll: false,
      //微信版本是否支持页面滚动回顶部
      share_btn: false,
      //自定义分享按钮状态
      actionSheetHidden: true,
      //自定义actionSheet隐藏True
      categories: [{
        name: "商品",
        id: 0
      }, {
        name: "详情",
        id: 1
      }, {
        name: "评论",
        id: 2
      }],
      activeCategoryId2: 0,
      //商品内容tab
      categories2: [{
        name: "商品详情",
        id: 0
      }, {
        name: "规格参数",
        id: 1
      }],
      activeCategoryId3: 0,
      //商品评论tab
      comments: null,
      categories3: [{
        name: "全部评价",
        id: 0,
        num: 0
      }, {
        name: "好评",
        id: 1,
        num: 0
      }, {
        name: "中评",
        id: 2,
        num: 0
      }, {
        name: "差评",
        id: 3,
        num: 0
      }, {
        name: "有图",
        id: 4,
        num: 0
      }],
      goods: null,
      team: null,
      teamResult: {
        server_time: 0,
        teamFounds: null
      },
      timer: null,
      select: {
        //选择的(规格)商品的参数，用于显示
        teamId: 0,
        teamPrice: 0,
        needer: 0,
        price: 0,
        stock: 0,
        statusDesc: '',
        shareDesc: ''
      },
      rule: true,
      imgs: [],
      //商品图片组
      options: null,
      show: false,
      spec_img: '',
      share_pic: "",
      openPromModal: false,
      article_content: ""
    };
  },

  components: {},
  props: {},
  onLoad: function (options) {
    if (options.first_leader) {
      uni.setStorageSync('first_leader', options.first_leader);
    }

    var that = this;
    var goodId = typeof options.goods_id == 'undefined' ? 0 : options.goods_id;
    var itemId = typeof options.item_id == 'undefined' ? 0 : options.item_id;
    var teamId = typeof options.team_id == 'undefined' ? 0 : options.team_id;
    this.setData({
      optiongoodId: goodId,
      optionItemId: itemId,
      spec_img: that.url + "/api/goods/goodsThumImages?goods_id=" + goodId + "&width=200&height=200"
    });
    this.getTeamList();
    request.get('/api/Team/info', {
      data: {
        goods_id: goodId,
        team_id: teamId
      },
      failRollback: true,
      success: function (res) {
        var result = res.data.result;
        that.setData({
          result: result,
          team: result.team_activity.team_goods_item
        }); //初始化评论

        that.initComment(); //初始化规格

        that.initSpecsPrice(result.team_activity.goods); //获取详情内容

        that.requestGoodsContent(); //图片组

        that.goodsImages(result.team_activity);
      }
    }); //是否支持返回按钮

    if (uni.pageScrollTo) {
      this.setData({
        supportPageScroll: true
      });
    }
  },
  onUnload: function () {
    clearInterval(this.timer);
  },

  /**
   * 转发按钮
   */
  onShareAppMessage: function (res) {
    var that = this;
    var team = that.result.team_activity;
    var url = that.url;
    return {
      title: team.goods_name,
      //自定义转发标题
      path: '/pages/team/team_info/team_info?goods_id=' + team.goods_id + '&item_id=' + team.item_id + '&team_id=' + team.team_id + '&first_leader=' + uni.getStorageSync('app:userInfo')['user_id'],
      imageUrl: team.goods.original_img ? url + team.goods.original_img : url + team.goods.spec_goods_price[0].spec_img
    };
  },
  methods: {
    //查看更多
    catmore: function () {
      this.setData({
        show: true
      });
    },
    clickMask: function () {
      this.setData({
        show: false
      });
    },

    /** 商品图片组 */
    goodsImages: function (data) {
      var img = data.goods.goods_images;
      var imgs = [];

      for (var i = 0; i < img.length; i++) {
        imgs.push(this.url + img[i]['image_url']);
      }

      this.setData({
        imgs: imgs
      });
    },

    /** 查看图片 */
    look: function (e) {
      uni.previewImage({
        current: e.currentTarget.dataset.src,
        // 当前显示图片的http链接
        urls: this.imgs // 需要预览的图片http链接列表

      });
    },

    /** 获取拼团列表 */
    getTeamList: function () {
      var that = this;
      request.post('/api/Team/ajaxTeamFound', {
        data: {
          goods_id: that.optiongoodId
        },
        failRollback: true,
        success: function (res) {
          var result = res.data.result;
          var teamFounds = result.teamFounds;

          for (var i = 0; i < teamFounds.length; i++) {
            if (teamFounds[i].head_pic && teamFounds[i].head_pic.indexOf("http") == -1) {
              teamFounds[i].head_pic = that.url + teamFounds[i].head_pic;
            }
          }

          that.setData({
            'teamResult.server_time': result.server_time,
            'teamResult.teamFounds': result.teamFounds
          });
          that.createTimer();
        }
      });
    },
    createTimer: function () {
      var that = this;
      var startTime = new Date().getTime();
      this.timer = setInterval(function () {
        if (that.teamResult.teamFounds.length <= 0) {
          return;
        }

        var teamFounds = that.teamResult.teamFounds;

        for (var i = 0; i < teamFounds.length; i++) {
          var diffTime = startTime - that.teamResult.server_time * 1000;
          teamFounds[i].remainTime = util.transTime((teamFounds[i].found_time + teamFounds[i].time_limit) * 1000 - new Date().getTime() + diffTime);

          if (teamFounds[i].remainTime.hour < 0) {
            clearInterval(that.timer);
            that.getTeamList();
          }
        }

        that.setData({
          'teamResult.teamFounds': teamFounds
        });
      }, 1000);
    },

    /** 初始化评论相关 */
    initComment: function () {
      //评论数
      this.categories3[0].num = this.result.team_activity.goods.comment_statistics.total_sum;
      this.categories3[1].num = this.result.team_activity.goods.comment_statistics.high_sum;
      this.categories3[2].num = this.result.team_activity.goods.comment_statistics.center_sum;
      this.categories3[3].num = this.result.team_activity.goods.comment_statistics.low_sum;
      this.categories3[4].num = this.result.team_activity.goods.comment_statistics.img_sum; //渲染视图

      this.setData({
        categories3: this.categories3
      });
    },

    /** 初始化所有规格 */
    initSpecsPrice: function (result) {
      var specSelect = 0; //初始化选中第一个规格

      var specs = result.spec_goods_price; //商品所有规格

      var team_activity = this.result.team_activity;

      if (specs.length == 0) {
        //没有规格
        this.setData({
          'select.prom_id': this.team[0].team_id,
          'select.teamPrice': this.team[0].team_price,
          'select.price': this.team[0].price ? this.team[0].price : team_activity.goods.shop_price,
          'select.stock': this.team[0].store_count ? this.team[0].store_count : team_activity.goods.store_count,
          'select.needer': this.team[0].needer ? this.team[0].needer : team_activity.needer,
          'select.statusDesc': this.team[0].front_status_desc ? this.team[0].front_status_desc : team_activity.front_status_desc,
          'select.shareDesc': this.team[0].share_desc ? this.team[0].share_desc : team_activity.share_desc
        });
        return;
      }

      if (this.optionItemId) {
        //指定规格
        for (var i = 0; i < specs.length; i++) {
          if (specs[i].item_id == this.optionItemId) {
            specSelect = i;
            break;
          }
        }
      } //生成子规格组(spec)的各自选中项


      var specIds = specs[specSelect].key.split("_");
      var list = result.spec;

      for (var i = 0; i < list.length; i++) {
        for (var j = 0; j < list[i].spec_item.length; j++) {
          if (util.inArray(list[i].spec_item[j].id, specIds)) {
            list[i].selectItemId = list[i].spec_item[j].id;
            break;
          }
        }
      }

      this.setData({
        specSelect: specSelect,
        'result.team_activity.goods.spec': list,
        'result.team_activity.goods.spec_goods_price': specs
      });
      this.initSelectSpecGoods(this.optionItemId > 0 ? this.optionItemId : specs[specSelect]['item_id']);
    },

    /** 检查规格商品 */
    initSelectSpecGoods: function (item_id) {
      var that = this;
      that.setData({
        spec_img: that.url + "/api/goods/goodsThumImages?goods_id=" + that.optiongoodId + "&width=200&height=200&item_id=" + item_id
      });
      request.post('/api/Team/ajaxCheckTeam', {
        data: {
          goods_id: that.result.team_activity.goods.goods_id,
          item_id: item_id
        },
        successReload: true,
        success: function (res) {
          that.initActivity(res.data);
        }
      });
    },

    /** 初始化选中的规格商品 */
    initActivity: function (data) {
      var that = this;

      if (data.status == 1) {
        var datas = data.result.team_goods_item;
        that.setData({
          'select.prom_id': datas.spec_goods_price.prom_id,
          'select.teamPrice': datas.team_price,
          'select.price': datas.spec_goods_price.price,
          'select.stock': datas.spec_goods_price.store_count,
          'select.needer': datas.team_activity.needer,
          'select.statusDesc': datas.team_activity.front_status_desc,
          'select.shareDesc': datas.team_activity.share_desc
        });
      } else {
        that.setData({
          'select.statusDesc': '未参与活动'
        });
      }
    },

    /** 联系客服 */
    contactService: function () {
      app.globalData.getConfig(function (res) {
        app.globalData.confirmBox('请联系客服：' + common.getConfigByName(res.config, 'phone'));
      });
    },
    collectGoods: function () {
      var that = this;
      request.post('/api/goods/collectGoodsOrNo', {
        data: {
          goods_id: that.result.team_activity.goods.goods_id
        },
        success: function (res) {
          app.globalData.showSuccess(res.data.msg);
          that.setData({
            'result.collect': !that.result.collect
          });
        }
      });
    },
    showRule: function () {
      this.setData({
        rule: !this.rule
      });
    },

    /** 商品首页 */
    tabClick: function (e) {
      var typeId = e.currentTarget.id;
      this.setData({
        activeCategoryId: typeId
      });

      if (typeId == 1) {
        this.tabGoodsContent();
      } else if (typeId == 2) {
        this.tabComment();
      }
    },

    /** 商品详情页 */
    tabClick2: function (e) {
      this.setData({
        activeCategoryId2: e.currentTarget.id
      });
    },

    /** 评论页 */
    tabClick3: function (e) {
      if (e.currentTarget.id == this.activeCategoryId3) {
        return;
      }

      this.setData({
        activeCategoryId3: e.currentTarget.id
      });
      this.requestComments(this.result.team_activity.goods.goods_id, e.currentTarget.id);
    },

    /** 请求评论数据 */
    requestComments: function (goodsId, commentType) {
      var that = this;
      commentType++;
      var requestUrl = that.url + '/api/goods/getGoodsComment?goods_id=' + goodsId + '&type=' + commentType;
      request.get(requestUrl, {
        success: function (res) {
          var comments = res.data.result;

          for (var i = 0; i < comments.length; i++) {
            comments[i].addTimeFormat = util.formatTime(comments[i].add_time);
            comments[i].goods_rank = parseInt(comments[i].goods_rank);
          }

          that.setData({
            comments: comments
          });
        }
      });
    },

    /** 返回顶部 */
    doScrollTop: function () {
      uni.pageScrollTo({
        scrollTop: 0
      });
    },

    /** 打开评论页 */
    tabComment: function () {
      this.setData({
        activeCategoryId: 2
      });

      if (!this.comments) {
        this.requestComments(this.result.team_activity.goods.goods_id, this.activeCategoryId3);
      }
    },

    /** 打开商品内容页 */
    tabGoodsContent: function () {
      this.setData({
        activeCategoryId: 1
      });
    },

    /** 请求商品详情页嵌入的html内容 */
    requestGoodsContent: function () {
      var that = this;
      request.get('/api/goods/goodsContent', {
        data: {
          id: that.result.team_activity.goods.goods_id
        },
        success: function (res) {
          //WxParse.wxParse('content', 'html', res.data.result.goods_content, that, 6)
          setTimeout(() => {
            that.article_content = res.data.result.goods_content;
          }, 200); //网页中的图片加上域名

          common.wxParseAddFullImageUrl(that, 'content');
          that.setData({
            goodsAttrs: res.data.result.goods_attr_list
          });
        }
      });
    },

    /** 点击规格按钮的回调函数 */
    selectSpec: function (e) {
      //对商品数量进行判断，对库存进行判断
      var itemId = e.currentTarget.dataset.itemid;
      var listIdx = e.currentTarget.dataset.listidx;
      var list = this.result.team_activity.goods.spec;
      var team_activity = this.result.team_activity;

      if (list[listIdx].selectItemId == itemId) {
        return;
      }

      list[listIdx].selectItemId = itemId;
      var newSpecKeys = [];

      for (var i = 0; i < list.length; i++) {
        newSpecKeys[i] = list[i].selectItemId;
      } //item排序,生成key


      var newSpecKeys = util.sortSize(newSpecKeys).join('_');
      var newSpecSelect = 0;
      var specs = this.result.team_activity.goods.spec_goods_price;

      for (var i = 0; i < specs.length; i++) {
        if (specs[i].key == newSpecKeys) {
          newSpecSelect = i;
          break;
        }
      }

      this.setData({
        specSelect: newSpecSelect,
        'result.team_activity.goods.spec': list,
        'result.team_activity.goods.spec_goods_price': specs,
        optionItemId: this.result.team_activity.goods.spec_goods_price[newSpecSelect].item_id
      });
      this.checkCartNum(this.goodsInputNum);
      this.initSelectSpecGoods(this.optionItemId);
    },

    /** 单独购买 */
    buyNormal: function () {
      var parmas = {
        goods_id: this.result.team_activity.goods.goods_id,
        item_id: this.optionItemId
      };
      uni.navigateTo({
        url: '/pages/goods/goodsInfo/goodsInfo?' + util.Obj2Str(parmas)
      });
    },

    /** 拼团立即购买 */
    buyNow: function () {
      var that = this; //检查用户是否登录方可操作立即购买

      if (!app.globalData.auth.isAuth()) {
        app.globalData.showLoading(null, 1500);
        app.globalData.getUserInfo();
        return;
      }

      if (that.select.prom_id <= 0) {
        return;
      }

      var spes = that.result.team_activity.goods.spec_goods_price;
      request.post('/api/Team/addOrder', {
        data: {
          item_id: spes.length > 0 ? spes[that.specSelect].item_id : '',
          goods_id: that.result.team_activity.goods.goods_id,
          goods_num: that.goodsInputNum
        },
        success: function (res) {
          that.setData({
            openSpecModal: false
          });
          uni.navigateTo({
            url: '/pages/team/team_confirm/team_confirm?orderSn=' + res.data.result.order_sn
          });
        }
      });
    },

    /** 增加购买的商品数量 */
    addCartNum: function (e) {
      this.checkCartNum(this.goodsInputNum + 1);
    },

    /** 减少购买的商品数量 */
    subCartNum: function (e) {
      this.checkCartNum(this.goodsInputNum - 1);
    },

    /** 输入购买的数量 */
    inputCartNum: function (e) {
      this.checkCartNum(Number(e.detail.value));
    },

    /** 检查购买的数量 */
    checkCartNum: function (num) {
      var stock = this.result.team_activity.goods.store_count;

      if (this.result.team_activity.goods.spec_goods_price.length > 0) {
        stock = this.result.team_activity.goods.spec_goods_price[this.specSelect].store_count;
      }

      if (num > stock || stock == 0) {
        num = stock;
      } else if (num < 1) {
        num = 1;
      }

      this.setData({
        goodsInputNum: num
      });
    },

    /** 关闭规格弹窗 */
    closeSpecModal: function () {
      this.setData({
        openSpecModal: false
      });
    },

    /** 打开规格弹窗 */
    openSpecModel: function () {
      this.setData({
        openSpecModal: true
      });
    },

    /** 预览图片 */
    previewCommentImgs: function (e) {
      var imgs = this.comments[e.currentTarget.dataset.cidx].img;
      uni.previewImage({
        current: imgs[e.currentTarget.dataset.id],
        urls: imgs
      });
    },

    /** 预览图片 */
    previewGoodsCommentImgs: function (e) {
      var that = this;
      var imgs = this.data.comment[e.currentTarget.dataset.cidx].img;
      imgs = imgs.map(function (val) {
        return that.url + val;
      });
      uni.previewImage({
        current: imgs[e.currentTarget.dataset.id],
        urls: imgs
      });
    },

    /**
    * 获取商品分享海报
    */
    getSharePic: function () {
      var that = this;
      that.setData({
        actionSheetHidden: !this.actionSheetHidden
      });
      uni.showLoading({
        title: '正在生成',
        mask: true
      });
      var item_id = that.optionItemId;
      uni.getImageInfo({
        src: that.url + '/api/goods/goodsSharePoster?id=' + that.optiongoodId + '&item_id=' + item_id + '&prom_type= 6 ' + '&leader_id=' + uni.getStorageSync('app:userInfo')['user_id'],
        success: function (res) {
          that.setData({
            share_btn: true,
            share_pic: res.path
          });
        },
        complete: function (res) {
          uni.hideLoading();
        }
      });
    },
    closeShareModal: function () {
      this.setData({
        share_btn: false
      });
    },
    listenerActionSheet: function (e) {
      this.setData({
        actionSheetHidden: !this.actionSheetHidden
      });
    },
    saveSharePic: function () {
      var that = this;
      uni.authorize({
        scope: 'scope.writePhotosAlbum',
        success: function (res) {
          uni.saveImageToPhotosAlbum({
            filePath: that.share_pic,
            success: function (res) {
              that.setData({
                share_btn: false
              });
              uni.showToast({
                title: '保存成功',
                duration: 2000
              });
            }
          });
        },
        fail: function (res) {
          common.checkAuthorize('scope.writePhotosAlbum');
        }
      });
    },
    previewSharePic: function () {
      uni.previewImage({
        urls: [this.share_pic]
      });
    },
    catchShare: function (e) {
      this.setData({
        actionSheetHidden: false
      });
    },
    closePromModal: function () {
      this.setData({
        openPromModal: false
      });
    }
  }
};
</script>
<style>
/* team_info.wxss */

.container{
    margin-bottom: 100rpx;
}
image{
    vertical-align: top;
}
.type-navbar{
    display: flex;
    justify-content: center;
    width: 100%;
    height:80rpx;
    margin-bottom: 20rpx;
    background-color: #fff;
    position: fixed;
    top: 0;
    z-index: 1;
}
.goods-detail{
    margin-top: 90rpx;
}
.type-box{
    width:25%;
    box-sizing: border-box;
    font-size: 28rpx;
    line-height: 76rpx;
    padding: 0 20rpx;
    text-align: center;
    display: inline-block;
    overflow: hidden;
}
.type-navbar-item{
    border-bottom: 4rpx solid #fff;
}
.type-item-on{
    border-bottom: 4rpx solid #ff6a00;
    font-weight: bold;
    color: #ff6a00;
}
.swiper_box {
    width: 100%;
    height: 750rpx;
}
.goods-title{
    display: flex;
    justify-content: space-between;
    height: 108rpx;
}
.goods-name{
    width: 560rpx;
    height: 88rpx;
    margin: 10rpx 0;
    line-height: 44rpx;
    font-size: 30rpx;
    color: #333;
}
.goods-collect{
    width: 112rpx;
    padding-top: 30rpx;
}
.collect-img{
    width: 50rpx;
    height: 44rpx;
    margin: 0 auto;
    overflow: hidden;
}
.collect-des{
    text-align: center;
    font-size: 24rpx;
    color: #333;
}
.goods-price{
    font-size: 30rpx;
    padding:20rpx 30rpx; 
    line-height: 40rpx;
    color: #999;
    border-bottom: 1px solid #f3f3f3;
}
.prom-info{
    margin: 10rpx 0;
    color: #ff6a00;
}
.prom-info>.prom-type{
    color: white;
    background-color: #ff6a00;
    margin-right: 14rpx;
    padding: 2rpx 8rpx;
    border-radius: 4rpx;
}
.market-price{
    display: flex;
}
.market-price>view{
    text-decoration: line-through;
}
.goods-num{
    display: flex;
    justify-content: space-between;
}
.logistics-item{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90rpx;
    border-bottom: 1px solid #f3f3f3;
    font-size: 24rpx;
    color: #666;
}
.item-title{
    width: 180rpx;
}
.item-mes{
    color: #333;
    width: 420rpx;
    height: 90rpx;
    line-height: 90rpx;
}
.item-img{
    width: 32rpx;
    height: 32rpx;
    margin-top: 4rpx;
}
.prom-item {
    color: #ff6a00;
    border: 1px solid #ff6a00;
    border-radius: 18rpx;
    line-height: 40rpx;
    height: 40rpx;
    padding: 2rpx 8rpx;
}
.guarantee{
    justify-content:flex-start;
}
.ico-item{
    width: 32rpx;
    height: 32rpx;
    margin-right: 10rpx;
}
.guarantee>view{
    display: flex;
    align-items: center;
    height: 32rpx;
    color: #666;
    width: 33.333333%;
}
.user-comment{
    margin:10rpx 0;
    font-size: 28rpx;
}
.good-comment,.comment-num{
    display: flex;
}
.co-red{
    line-height: 40rpx;
}
.recommend{
    background-color: #fff;
    border-bottom: 1px solid #f3f3f3;
    padding-bottom: 20rpx;
}
.recommend-title{
    height: 70rpx;
    line-height: 70rpx;
    font-size: 28rpx;
    padding: 0 30rpx;
}
.recommend-ul{
    display: flex;
    justify-content: flex-start;
}
.recommend-ul .li{
    width: 25%;
    box-sizing: border-box;
    text-align: center;
    font-size: 28rpx;
    color: #333;
}
.shops-mes{
    position: relative;
    margin: 10rpx 0;
    padding: 20rpx 30rpx;
    background-color: #fff;
}
.shops-info{
    display: flex;
    height: 100rpx;
}
.shops-pic{
    width: 100rpx;
    height: 100rpx;
    margin-right: 20rpx;
    border: 1px solid #f3f3f3;
}
.shops-name{
    height: 100rpx;
    width: 420rpx;
    line-height: 50rpx;
    font-size: 30rpx;
}
.store-desc{
    font-size: 28rpx;
    color: #898989;
}
.scores-common{
    position: absolute;
    right: 30rpx;
    top: 80rpx;
    font-size: 28rpx;
    line-height: 1;
    color:#333;
}
.scores-list{
    display: flex;
    height: 120rpx;
    padding:20rpx 0; 
}
.scores-item{
    width: 33.333%;
    font-size: 28rpx;
    color:#666;
    text-align: center;
    line-height: 40rpx;
}
.scores-btns{
    height: 64rpx;
}
.scores-btns-item{
    float: left;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 330rpx;
    height: 60rpx;
    border:1px solid #f3f3f3;
    font-size: 28rpx;
    color: #666;
}
.scores-btns-item:first-child{
    margin-right: 20rpx;
}
.scores-btns-pic{
    width:40rpx;
    height:37rpx;
    margin:0 10rpx;
}
.li-img{
    width: 120rpx;
    height: 120rpx;
    margin: 0 auto;
}
.li-title{
    height: 58rpx;
    line-height: 30rpx;
    margin: 10rpx 0;
}
.comment-item{
    background-color: #fff;
    font-size: 28rpx;
}
.comment-title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 102rpx;
    margin:0 30rpx;
    color: #333;
    border-bottom: 1px solid #f3f3f3;
}
.user-name{
    display: flex;
    align-items: center;
}
.user-pic{
    width: 54rpx;
    height: 54rpx;
    margin-right: 10rpx;
    border-radius:50%;
    overflow: hidden;
}
.stars{
    float: left;
    display: flex;
    height: 42rpx;
    line-height: 42rpx;
    margin:15rpx 0; 
    width: 200rpx;
}
.star{
    width: 30rpx;
    height: 28rpx;   
}
.state-spec{
    margin:15rpx 0; 
    float: right;
    font-size: 24rpx;
    color: #666;
    width: 460rpx;
    text-align: right;
}
.comment-cont{
    padding: 0 30rpx 30rpx;
    border-bottom: 1px solid #f3f3f3;
}
.comment-cont view{
    overflow: hidden;
}
.comment-mes{
    line-height: 42rpx;
}
.img-ul{
    display: flex;
    flex-wrap: wrap;
}
.img-li{
    width: 120rpx;
    height: 120rpx;
    margin: 8rpx;
}
.comment-btn{
    height: 60rpx;
    padding: 20rpx 30rpx;
}
.comment-btn .btn{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60rpx;
    width: 45%;
    border: 1px solid #f3f3f3;
}
.comment-btn .btn-img{
    width: 30rpx;
    height: 28rpx;
    margin: 0 10rpx;
}
.reply-ul{
    margin-top: 20rpx;
}
.reply-li{
    color: #aaa;
}
.join-cart{
    position: fixed;
    left: 0;
    bottom: 0;
    display: flex;
    width: 100%;
    height: 100rpx;
    background-color: #fff;
    text-align: center;
}
.join-cart>view{
    width: 25%;
}
.cart-ico{
    font-size: 24rpx;
    color: #333;
}
.shopping-cart{
    position: relative;
}
.cs-img{
    width: 45rpx;
    height: 40rpx;
    margin-top: 15rpx;
}
.sc-img{
    width: 42rpx;
    height: 40rpx;
    margin-top: 15rpx;
}
.cart-num{
    position: absolute;
    left: 50%;
    top: 0;
    width: 40rpx;
    height: 40rpx;
    line-height: 40rpx;
    text-align: center;
    border-radius: 50%;
    color: #fff;
    background-color: rgba(217,81,99,0.9);
}
.cart-btn{
    font-size: 28rpx;
    color: #fff;
    padding: 16rpx 0;
    line-height: 34rpx;
}
.join-btn{
    background-color: #ff9c00;
}
.buy-btn{
    background-color: #ff6a00;
}
view.cart-btn-lg{
    width: 50%;
}
.toTop{
    position: fixed;
    z-index: 3;
    right: 20rpx;
    bottom: 160rpx;
    width: 68rpx;
    height: 68rpx;
    border:1px solid #f3f3f3;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}
.comment-more{
    height: 56rpx;
    line-height: 56rpx;
    font-size: 26rpx;
    color: #999;
    text-align: center;
    background-color: #eee;
}
.goods-more{
    background-color: #fff;
}
/* 详情 */
.goods-norms{
    background-color: #fff;
}
.type-navbar2{
    display: flex;
    height: 72rpx;
    border-top:1px solid #f3f3f3;
    border-bottom:1px solid #f3f3f3;
}
.type-box2{
    width:50%;
    font-size: 26rpx;
    line-height: 72rpx;
    text-align: center;
    overflow: hidden;
}
.type-item2-on{
    color: #ff6a00;
}
.parameter{
    padding: 40rpx 0;
}
.table{
    width: 698rpx;
    margin: 0 auto;
    border:1px solid #f3f3f3;
    border-bottom: none;
}
.tb{
    width: 100%;
    min-height: 69rpx;
    line-height: 69rpx;
    border-bottom:1px solid #f3f3f3;
    font-size: 28rpx;
    text-align:center; 
    color: #333;
}
.th-thitle{
    font-weight: bold;
    background-color:#f5fafe; 
}
.td-cont{
    display: flex;
}
.td-title{
    width: 259rpx;
    background-color:#f5fafe; 
    border-right:1px solid #f3f3f3;
}   
.td-text{
    width: 439rpx;
}
/* 评论 */
.goods-comment{
    background-color: #fff;
}
.type-navbar3{
    display: flex;
    height: 88rpx;
    border-top:1px solid #f3f3f3;
    border-bottom:1px solid #f3f3f3;
}
.type-box3{
    width:20%;
    font-size: 28rpx;
    line-height: 44rpx;
    text-align: center;
    overflow: hidden;
}
.type-item3-on{
    color: #ff6a00;
}
/* 规格弹框 */
.spec-model{
    position: fixed;
    bottom: 0;
    z-index: 9999;
    background: white;
    width: 100%;
    padding: 0 30rpx 30rpx 30rpx;
    font-size: 32rpx;
    box-sizing: border-box;
    overflow-x: hidden;
}
.spec-goods{
    padding: 15rpx 0 30rpx;
    float: left;
    width: 100%;
    border-bottom: 1px solid #f3f3f3;
}
.spec-img{
    float: left;
    height: 150rpx;
    width: 150rpx;
    margin-top:16rpx;
}
.spec-goods-info{
    float: left;
    padding: 0 25rpx; 
    width: 490rpx;
}
.spec-goods-name{
    font-size: 30rpx;
    line-height: 35rpx;
    max-height: 70rpx;
    margin: 15rpx 20rpx 20rpx 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spec-goods-price{
    color: #ff6a00;
    font-size: 30rpx;
    font-weight: bold;
}
.spec-goods-stock{
    margin-top: 10rpx;
    font-size: 26rpx;
    color: #999999;
}
.spec-name{
    clear: both;
    padding: 20rpx 0;
    font-size: 30rpx;
    font-weight: bold;
}
.muber_all{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 50rpx;
  padding: 20rpx 0;
}
.muber_all .spec-name{
  padding: 0;
}
.count{
    width: 294rpx;
    height: 50rpx;
    font-size: 36rpx;
}
.count>view,.count>input{
    float: left;
    width: 98rpx;
    height: 50rpx;
    line-height: 50rpx;
    text-align: center;
}
.sub{
    width: 98rpx;
    font-weight: bold;
}
.add{
    width: 98rpx;
    font-weight: bold;
}
.spec-btn{
    color: black;
    background-color: #efefef;
    padding: 11rpx 27rpx;
    font-size: 26rpx;
    line-height: 28rpx;
    float: left;
    border: 1rpx solid #f3f3f3;
    margin: 4rpx 34rpx 4rpx 0;
    border-radius: 30rpx;
}
.spec-btn-click{
    background-color: #ffefef;
    color: #ff3a3a;
    border: 1rpx solid #ff6a00;
}
.spec-cart-btn{
    margin-top: 30rpx;
    /* padding: 30rpx; */
    /* width: 100%; */
    font-size: 30rpx;
    text-align: center;
    color: #fff;
    /* background-color: #ff6a00; */
    width: 690rpx;
    height: 68rpx;
    background-color: #fb4242;
    border-radius: 68rpx;
    line-height: 68rpx;
}
.spec-add-cart{
    background-color: #ffb03f;
}
.spec-buy{
    background-color: #ff6a00;
    margin-left: 34rpx;
}
.spec-cart-disable{
    background: #bbbbbb;
}
.spec-cart-btn-lg{
    width: 614rpx;
}
/* 优惠信息弹框 */
.prom-model{
    position: fixed;
    bottom: 0;
    z-index: 20;
    background: white;
    width: 100%;
    padding: 0 30rpx 30rpx;
    font-size: 32rpx;
    box-sizing: border-box;
    overflow-x: hidden;
}
.prom-model .prom-title{
    text-align: center;
    margin: 30rpx 0;
}
.prom-model .logistics-item{
    border: 0;
}
.prom-model .item-mes{
    width: 500rpx;
}
/*拼团新增的*/
.pt-goods{
    background-color: #fff;
}
.pt-goods-name{
    width: 704rpx;
    height: 82rpx;
    margin: 0rpx auto;
    padding: 20rpx 0 0 0;
    margin-bottom: 20rpx;
    line-height: 40rpx;
    font-size: 30rpx;
    color: #1d1d1d;
    font-weight: 600;
}
.pt-tips{
    display: flex;
    height: 80rpx;
    line-height: 80rpx;
    padding-left: 30rpx;
}
.pt-tips .co-red{
    font-size: 36rpx;
    font-weight: bold;
}
.pt-tips .pt-btn{
    width: 100rpx;
    height: 50rpx;
    margin-left: 20rpx;
    text-align: center;
    color: #fff;
    font-size: .7rem;
    background-color: #ff6a00;
    border-radius: 12rpx;
	margin-top: -5rpx;
	line-height: 50rpx;
}
.pt-price{
    line-height: 80rpx;
    font-size: 30rpx;
    color: #666;
    padding-left: 30rpx;
}
.pt-price>text{
    text-decoration:line-through;
    margin-left: 20rpx;
}
.pt-des{
    padding: 0 30rpx 20rpx;
    font-size: 30rpx;
    line-height: 60rpx;
    color: #999;
    border-bottom: 1px solid #f3f3f3;
}
.pt-icos{
    display: flex;
    height: 28rpx;
    line-height: 28rpx;
    padding: 30rpx 0;
}
.pt-icos.pt-icos>view{
    width: 33.33%;
    font-size: 24rpx;
    color: #333;
    text-align: center;
}
.pt-icos image{
    width: 32rpx;
    height: 28rpx;
}
.pt-rule{
    margin-top: 20rpx;
    background-color: #fff;
}
.pt-rule-name{
    padding-left: 30rpx;
    font-size: 30rpx;
    line-height: 112rpx;
    color: #555;
}
.pt-rule-list{
    display: flex;
}
.pt-rule-list>view{
    width: 25%;
    line-height: 100rpx;
    text-align: center;
    color: #999;
    font-size: 26rpx;
}
.pt-rule-num{
    margin: 0 auto;
    width: 100rpx;
    height: 100rpx;
    font-size: 36rpx;
    border: 1px dashed #999;
    border-radius: 50%;
}
.pt-ico5{
    height: 48rpx;
    text-align: center;
}
.pt-ico5 image{
    width: 32rpx;
    height: 24rpx;
}
.transform image{
    transform:rotate(-180deg)
}
.pt-rule-cont{
    padding: 20rpx 30rpx 0;
    background-color: #fdfbe4;
    font-size: 30rpx;
    line-height: 42rpx; 
    color: #666;
}
.pt-rule-cont>view{
    margin-bottom: 20rpx;
}
.spec-wrap{
    overflow: hidden;
}
.pt-order-tips{
    line-height: 80rpx;
    padding-left: 30rpx;
    font-size: 30rpx;
    color: #555;
}
.pt-order-list{
    background-color: #fff;
    padding-top: 10rpx;
    overflow: hidden;
}
.pt-order-item{
    display: flex;
    width: 630rpx;
    margin: 0 0 30rpx 70rpx;
}
.pt-order-cont{
    position: relative;
    display: flex;
    justify-content: space-between;
    border: 2rpx solid #ff6a00;
    height:64rpx;
    padding: 16rpx 0 16rpx 70rpx;
    width: 400rpx;
    font-size: 24rpx; 
    line-height: 32rpx;
    color: #999;
}
.co-333{
    color: #333;
}
.pt-user{
    width: 180rpx;
}
.pt-time{
    width: 180rpx;
}
.pt-avtar{
    position: absolute;
    left: -49rpx;
    top:-2rpx;
    width: 100rpx;
    height: 100rpx;
    border-radius: 50%;
    overflow: hidden;
}
.pt-order-btn{
    width: 180rpx;
    height: 68rpx;
    line-height: 68rpx;
    padding:16rpx 0 16rpx 0;
    border-radius: 0 50rpx  50rpx 0;
    background-color: #ff6a00;
    color: #fff;
    text-align: center;
    font-size: 30rpx;
}


/** 查看更多start **/
.modal-image image{width: 100%;height: 100%}
.modal-mask {
  position: fixed;
  z-index: 99999;
  background-color: rgba(0,0,0,0.6);
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.modal-content {
  width: 562rpx;
  height: 750rpx;
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius:9rpx;
  background-color: #fff;
  transform: translate(-50%,-50%);
} 
.modal-content .modal-title {
  width: 100%;
  height: 94rpx;
  border-bottom: 1rpx solid #f3f3f3;
  text-align: center;
  line-height: 94rpx;
  font-size: 38rpx;
  font-weight: bold;
}
.modal-content .modal-close {
  position: absolute;
  width: 56rpx;
  height: 56rpx;
  border-radius: 50%;
  top: -28rpx;
  right: -28rpx;
  background-image: url('');
  background-size: 56rpx;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff;
}
.modal-list {
  padding: 0 30rpx;
  height: 656rpx;
  overflow-x: hidden;
  overflow-y: scroll;
}
.modal-list .modal-list-content {
  width: 100%;
  height: 100rpx;
  border-bottom: 1rpx solid #f3f3f3;
  overflow: hidden;
  margin: 19rpx 0;
  font-size: 28rpx;
  position: relative;
}
.modal-list .modal-list-content .modal-image {
  width: 75rpx;
  height: 75rpx;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
  background-color: #ccc;
  float: left;
  margin-top: 9rpx;
}
.modal-list .modal-list-content .modal-info {
  float: left;
  height: 94rpx;
  line-height: 47rpx;
  text-align: left;
  margin-left: 28rpx;
}
.modal-list .modal-list-content .modal-btn {
  padding: 0 19rpx;
  height: 56rpx;
  border-radius: 28rpx;
  background-color: #e23435;
  color: #fff;
  line-height: 56rpx;
  text-align: center;
  margin-top: 19rpx;
  position: absolute;
  right: 0;
}

.modal-list .modal-list-content .view{
   width: 270rpx;
   display: flex;
}


.modal-list .modal-list-content .modal-person{
    width: 170rpx;
    white-space:nowrap;
    text-overflow:ellipsis;
    overflow:hidden;
}


.modal-list .modal-list-content .modal-person-info{
    width: 150rpx;
    white-space:nowrap;
    text-overflow:ellipsis;
    overflow:hidden;
}

.modal-list .modal-list-content .modal-info .modal-time {
  width: 270rpx;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
/** 查看更多end **/
.just{
    justify-content: space-between;
}
.flex{
    display: flex;
}
.just .pt-order-tips:last-child{
    padding-right: 30rpx;
}
.just .pt-order-tips:first-child{
    color: #333;
}
/* 商品海报分享*/

.share-btn {
    display: inline-block;
    margin-top: 12rpx;
    margin-left: 12rpx;
    height: 50rpx;
    width: 50rpx;
}

.share-btn image{
    width: 100%;
    height: 100%;
}

.share-save-btns{
    background-color: #fff;
    width: 100%;
    line-height: 80rpx;
}

.share-save-btn {
    width: 80%;
    height: 80rpx;
    text-align: center;
    margin: 0px auto;
    background-color: #ff6a00;
    color: #fff;
    border-radius: 10rpx;
}

.share-pic {
    width: 270rpx;
    height: 480rpx;
    margin: 20rpx auto ;
    background-color: #999;
    box-shadow: 0rpx 5rpx 5rpx 5rpx #cccccc
}

.share-tips {
    font-size: 9pt;
    color: #999;
    display: block;
    margin-top: 10rpx;
    width: 100%;
    text-align: center;
}
.action-sheet-btn{
  width: 100%;
  border: 0;
  height: 48rpx;
  line-height: 48rpx;
  font-size: 18px;
}
.action-sheet-btn::after{
  border: 0;
}
</style>